package com.tanghy.web.controller.impl;

import com.tanghy.web.service.TestService;
import com.wordnik.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/****************************************************************************************
 * Author: TangHuaiYu
 * Date: 2016/12/13
 * Time: 14:38
 * Description: 测试接口
 ***************************************************************************************/
@Controller
@RequestMapping(value = "test")
public class TestController {

    @Autowired
    private TestService service;

    @RequestMapping(value = "/query", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
    @ResponseBody
    @ApiOperation(value = "用户详情查询接口")
    public Object query(@RequestParam String item) {
        return "Hello "+item+"!";
    }

    @RequestMapping(value = "/queryAll", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
    @ResponseBody
    @ApiOperation(value = "用户详情查询接口")
    public Object queryAll() {
        Object o = service.queryAll();
        return o;
    }
}